<?php

/**
 * Loobica common view
 * 
 * @project : Loobica Ads
 * @author  : Dino (DBK)
 * @date    : 22 Jan 2014
 * 
 */
if (!defined('BASEPATH'))
  exit('No direct script access allowed');

class Common_view {

  var $ci;

  /**
   * Getting CI Instance
   * 
   */
  public function __construct() {
    $this->ci = & get_instance();
  }

  public function render_navbar($main_data = array()) {
    $nav_data = array();
    $view_data = array_merge($nav_data, $main_data);
    $this->ci->load->view('common/navbar', $view_data);
  }

  public function render_sidebar($main_data = array()) {
    $side_data = array();
    $side_data['categories'] = $this->ci->category_model->get_categories();
    $view_data = array_merge($side_data, $main_data);
    $this->ci->load->view('common/sidebar', $view_data);
  }

  public function render_url_title($url = null, $title = null) {
    $view_data = array();
    $view_data['url'] = $url;
    $view_data['title'] = $title;
    $this->ci->load->view('common/url_title', $view_data);
  }

}

?>
